<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>

<script type="text/javascript">
const treeRoot = {
	val: 3,
	left: { val: 9 },
	right: {
		val: 20,
		left: { val: 15, left: null, right: null },
		right: { val: 7, left: null, right: null },
	},
};

function getTreeToArr (tree) {
	let result = [];
	
	return result;
}
console.log(getTreeToArr(treeRoot));
</script>
</body>
</html>